﻿<UserControl x:Class="Ewav.LineList"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:GadgetSelector="clr-namespace:Ewav.ContextMenu;assembly=Ewav.ContextMenu.Menu"
	xmlns:Common="clr-namespace:CommonLibrary;assembly=CommonLibrary"
	mc:Ignorable="d"
	d:DesignHeight="610" d:DesignWidth="700"
	xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
DataContext="{Binding Source={StaticResource Locator}, Path=LineListViewModel}"
	xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">

    <Grid x:Name="LayoutRoot" Background="White"  MouseRightButtonDown="LayoutRoot_MouseRightButtonDown">

    	<Grid x:Name="GadgetWindow" Background="White" MinWidth="650">
			<Grid.RowDefinitions>
        		<RowDefinition Height="50"/>
        		<RowDefinition/>
        	</Grid.RowDefinitions>
        	<Grid.ColumnDefinitions>
        		<ColumnDefinition Width="Auto"/>
        		<ColumnDefinition/>
        	</Grid.ColumnDefinitions>

    		<Rectangle x:Name="GWindow" Style="{StaticResource GWindow}" Stroke="{StaticResource WindowBrush}" StrokeThickness="4" Grid.RowSpan="2" Grid.ColumnSpan="2" />
    		<StackPanel d:LayoutOverrides="VerticalAlignment, GridBox" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="13,11,0,0">
    			<TextBlock x:Name="GName" TextWrapping="Wrap" Text="Line List" VerticalAlignment="Top" Margin="0,0,26,0" Height="Auto" HorizontalAlignment="Left" Foreground="#FF2B4360" FontSize="21.333"/>

    			<Rectangle x:Name="GHeader" VerticalAlignment="Top" Height="4" Margin="0,2,0,0" StrokeThickness="0" Fill="#FF00B050" />	
    		</StackPanel>
    		<StackPanel HorizontalAlignment="Right" Margin="180,9,11,0" Orientation="Horizontal" VerticalAlignment="Top" Grid.Column="1">
                 <Button x:Name="FilterButton" Content="" Template="{StaticResource FilterButton}" Cursor="Hand" Click="FilterButton_Click" Width="24" Height="24" IsEnabled="False" >
                	<Button.Effect>
                		<DropShadowEffect Color="#FFB0B0B0" ShadowDepth="1"/> 
                	</Button.Effect>
                </Button>
                <Button x:Name="HeaderButton" Content="" Template="{StaticResource HeaderButton}" Cursor="Hand" Click="HeaderButton_Click"  Width="24" Height="24" >
                	<Button.Effect>
                		<DropShadowEffect Color="#FFB0B0B0" ShadowDepth="1"/>
                	</Button.Effect>
                </Button>
                <Button x:Name="ResizeButton" Content="" Template="{StaticResource resizebtn}" Cursor="Hand"  Width="24" Height="24" Click="ResizeButton_Click">
                    <Button.Effect>
    					<DropShadowEffect Color="#FFB0B0B0" ShadowDepth="1"/>
    				</Button.Effect>
    			</Button>
                <Button x:Name="CloseButton" Content="" Template="{StaticResource CloseButton}" Cursor="Hand"  Width="24" Height="24" Click="CloseButton_Click">
                    <Button.Effect>
    					<DropShadowEffect Color="#FFB0B0B0" ShadowDepth="1"/>
    				</Button.Effect>
    			</Button>
    		</StackPanel>
    		<Grid x:Name="GadgetContentGrid" Grid.Row="1" Margin="0,5,0,10" MinHeight="30" Grid.ColumnSpan="2">

    			<toolkit:Expander Margin="0,-45,131,0" VerticalAlignment="Top"  x:Name="gadgetExpander"
    				ExpandDirection="Down" IsExpanded="False" Style="{StaticResource ExpanderStyle2}" Canvas.ZIndex="999" HorizontalAlignment="Right">

    				<toolkit:Expander.Header>
    					<TextBlock Text="Edit Properties" FontFamily="Segoe UI" Cursor="Hand" FontSize="13.333" FontWeight="Normal" Foreground="White" />
    				</toolkit:Expander.Header>
    				<Grid Background="#FF5C53AC" HorizontalAlignment="Right" Margin="0,-2,-88,0">
    					<StackPanel Orientation="Vertical" Margin="10,5,10,10" HorizontalAlignment="Center" VerticalAlignment="Top" >

    						<Grid x:Name="grdLineListOptions" Width="Auto" Margin="0,0,0,2" VerticalAlignment="Top">
    							<Grid.RowDefinitions>
    								<RowDefinition Height="24"/>
    								<RowDefinition Height="30"/>
    								<RowDefinition Height="24"/>
    								<RowDefinition Height="30"/>
    								<RowDefinition Height="24"/>
    								<RowDefinition Height="30"/>
    								<RowDefinition Height="24"/>
    								<RowDefinition Height="24"/>
    								<RowDefinition Height="24"/>
    								<RowDefinition Height="24"/>
    								<RowDefinition Height="24"/>
    								<RowDefinition Height="25"/>
    								<RowDefinition Height="15"/>
    							</Grid.RowDefinitions>

    							<Grid.ColumnDefinitions>
    								<ColumnDefinition Width="200"/>
    								<ColumnDefinition Width="200"/>
    								<ColumnDefinition Width="200"/>
    							</Grid.ColumnDefinitions>
    							<TextBlock x:Name="tblockListVariablesToDisplay" Grid.Row="0" Grid.RowSpan="1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="0,0,0,0" Text="List variables to display:" TextAlignment="Center" Foreground="White" />
    							<ListBox VirtualizingStackPanel.VirtualizationMode="Recycling" FontFamily="Global User Interface" Grid.Row="1" Grid.RowSpan="10" HorizontalAlignment="Left" Margin="0,0,0,0" x:Name="lbxFields" SelectedIndex="0" SelectionMode="Extended" Width="192" SelectionChanged="lbxFields_SelectionChanged" />

    							<TextBlock x:Name="tblockSortVariables" Grid.Row="0" Grid.Column="1" VerticalAlignment="Bottom" Grid.RowSpan="1" HorizontalAlignment="Left" Margin="0,0,0,0" Text="Sort variables:" TextAlignment="Center" Foreground="White" />
    							<ComboBox HorizontalAlignment="Left" x:Name="cbxSortField" SelectedIndex="0" Width="192" Grid.Column="1" Grid.Row="1" Height="30" VerticalAlignment="Top" Padding="6,1,0,3" SelectionChanged="cbxSortField_SelectionChanged"/>

    							<TextBlock x:Name="tblockSortOrder" Grid.Row="2" Grid.Column="1" VerticalAlignment="Bottom" Grid.RowSpan="1" HorizontalAlignment="Left" Margin="0,0,0,0" Text="Sort order:" TextAlignment="Center" Foreground="White" />
    							<Button x:Name="btnRemoveVariables" Content="X" Grid.Column="1" HorizontalAlignment="Left" Margin="65,4,0,-1" Width="16" Height="16" Style="{StaticResource Delete}" Grid.Row="2" ToolTipService.ToolTip="Clear Selected Variables" Cursor="Hand" VerticalAlignment="Center" Click="btnRemoveVariables_Click"/> <!--Click="btnRemoveVariables_Click"-->
    							<ListBox FontFamily="Global User Interface" Grid.Row="3" Grid.Column="1" Grid.RowSpan="8" HorizontalAlignment="Left" Margin="0,0,0,0" x:Name="lbxSortFields" SelectedIndex="0" SelectionMode="Single"  Width="192" />

    							<TextBlock x:Name="tblockGroupResultsBy" Grid.Row="0" Grid.Column="2" VerticalAlignment="Bottom" Grid.RowSpan="1" HorizontalAlignment="Left" Margin="0,0,0,0" Text="Group results by:" TextAlignment="Center" Foreground="White" />
    							<ComboBox HorizontalAlignment="Left" MaxWidth="160" x:Name="cbxGroupField" SelectedIndex="0" Width="160" Grid.Column="2" Grid.Row="1" Height="30" VerticalAlignment="Top" />

    							<TextBlock x:Name="tblockMaxVarNameLength" Grid.Column="2" Grid.Row="2" VerticalAlignment="Bottom"  HorizontalAlignment="Left" TextAlignment="Center" Text="Max variable name length:" Margin="0,5,0,0" Foreground="White"  />
    							<TextBox x:Name="txtMaxColumnLength" Grid.Column="2" Grid.Row="3"  Width="60" HorizontalAlignment="Left" Text="24" Margin="0, 0, 0, 0" />

    							<TextBlock x:Name="tblockMaxRows" Grid.Column="2" Grid.Row="4" VerticalAlignment="Bottom" HorizontalAlignment="Left" TextAlignment="Center" Text="Max rows to display:" Margin="0,5,0,0" Foreground="White"  />
    							<TextBox x:Name="txtMaxRows" Grid.Column="2" Grid.Row="5" Width="60" HorizontalAlignment="Left" Text="50" Margin="0, 0, 0, 00" Visibility="Collapsed"  /> <!--TextChanged="txtMaxRows_TextChanged"-->

    							<TextBlock x:Name="tblockInst1" Grid.Column="0" Grid.Row="11" FontSize="9" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Left" TextAlignment="Left" Text="Ctrl+Left-click on variable names. Ctrl+A will select all variables." Margin="0,0,0,0" Foreground="White"  />
    							<TextBlock x:Name="tblockInst2" Grid.Column="1" Grid.Row="11" FontSize="9" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Left" TextAlignment="Left" Text="* Right-click on variables to remove or change sort properties." Margin="0,0,0,0" Foreground="White" Visibility="Collapsed" />
    							<StackPanel Grid.Row="6" Grid.RowSpan="8" Margin="0,8,0,0" Grid.Column="2">
    								<CheckBox x:Name="checkboxTabOrder" Margin="0,2,0,0" Content="Sort variables by tab order" Visibility="Collapsed" IsEnabled="true" Foreground="White" FontSize="13.333" Padding="-1,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Height="20" MinHeight="25" />
    								<CheckBox x:Name="checkboxUsePrompts" Margin="0,2,0,0" Content="Use field prompts" Visibility="Collapsed" IsEnabled="true" Foreground="White" FontSize="13.333" Padding="-1,0,0,0" MinHeight="25" />
    								<CheckBox x:Name="checkboxListLabels" Margin="0,2,0,0" Content="Display list labels" IsEnabled="true" Foreground="White" FontSize="13.333" Padding="-1,0,0,0" MinHeight="25" Visibility="Collapsed"/>
                                <!--<CheckBox x:Name="checkboxAltRowColors" Content="Alternating row colors" Grid.Row="10" Grid.Column="2" Visibility="Collapsed" IsEnabled="true" />-->
    								<CheckBox x:Name="checkboxLineColumn" Margin="0,2,0,0" Content="Show line column" IsChecked="True" Foreground="White" FontSize="13.333" Padding="-1,0,0,0" MinHeight="25" />
    								<CheckBox x:Name="checkboxColumnHeaders" Margin="0,2,0,0" Content="Show column headings" IsChecked="True" Foreground="White" FontSize="13.333" Padding="-1,0,0,0" MinHeight="25" />
    								<CheckBox x:Name="checkboxShowNulls" Margin="0,2,0,0" Content="Show missing representation" IsChecked="True" FontSize="13.333" Padding="-1,0,0,0" MinHeight="25" Foreground="White" />
    								<CheckBox x:Name="checkboxAllowUpdates" Margin="0,2,0,0" Content="Allow updates" Visibility="Collapsed" IsEnabled="true" FontSize="13.333" Padding="-1,0,0,0" MinHeight="25" />
    							</StackPanel>
    							<ComboBox HorizontalAlignment="Left" MaxWidth="160" x:Name="cbxMaxRows" SelectedIndex="0" Width="60" Grid.Column="2" Grid.Row="5" Height="30" VerticalAlignment="Top" >
    								<ComboBoxItem Content="50" IsSelected="True"/>
    								<ComboBoxItem Content="100"/>
                                    <ComboBoxItem Content="150"/>
                                    <ComboBoxItem Content="200"/>
                                    <ComboBoxItem Content="250"/>
                                    <ComboBoxItem Content="300"/>
                                    <ComboBoxItem Content="350"/>
                                    <ComboBoxItem Content="400"/>
                                    <ComboBoxItem Content="450"/>
                                    <ComboBoxItem Content="500"/>
                                </ComboBox>
    						</Grid>

                            <Button x:Name="btnRun" Content="Run Gadget" Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Top" Margin="0,-10,0,0" Style="{StaticResource btnSec}" Height="30" Click="button1_Click" Cursor="Hand"/>

    					</StackPanel>

    				</Grid>
    			</toolkit:Expander>

                <StackPanel x:Name="spContent" Orientation="Vertical" Margin="10,6,10,10">
                    <TextBlock x:Name="txtGadgetDescription" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="3,3,0,6" Visibility="Visible" MaxWidth="650" Padding="0,0,10,0"/>
                    <StackPanel x:Name="pnlStatus" Height="40" MaxHeight="40" Width="Auto" Background="#FFf8d7e2" VerticalAlignment="Top" Margin="0,5" Visibility="Collapsed">
    					<StackPanel x:Name="pnlStatusTop" Height="2" Width="Auto" Background="#FFe4658e"/>
    					<Image x:Name="ErrorIcon" Source="/Ewav;component/Images/error.png" Width="18" Height="18" HorizontalAlignment="Left" Margin="5,1,5,0" VerticalAlignment="Center"/>
    					<TextBlock x:Name="txtStatus" Text="Error: Exception occurred." TextWrapping="Wrap" Margin="30,-15,5,5" HorizontalAlignment="Left" FontWeight="Bold" VerticalAlignment="Center"/>
    				</StackPanel>
    				<StackPanel x:Name="panelMain" HorizontalAlignment="Left" VerticalAlignment="Top">
          
    				</StackPanel>
    			</StackPanel>
    			<Grid x:Name="waitCursor" Background="#36C4C4C4" Height="Auto" Visibility="Collapsed">
    				<toolkit:BusyIndicator x:Name="BusyIndicator" IsBusy="True" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="100" />			
    			</Grid>
    		</Grid>
    	</Grid>

    </Grid>
</UserControl>
